<template>
  <div class="departments-container">
    <div class="app-container">
      <el-card class="tree-card">
        <!-- 组织架构头部 -->
        <el-row type="flex" justify="space-between" align="middle" style="height: 40px">
          <el-col :span="20">
            <span>江苏传智播客教育科技股份有限公司</span>
          </el-col>
          <el-col :span="4">
            <el-row type="flex">
              <!-- 两个内容 -->
              <el-col :span="12">负责人</el-col>
              <el-col :span="12">
                <!-- 下拉菜单 element -->
                <el-dropdown>
                  <span>
                    操作<i class="el-icon-arrow-down" />
                  </span>
                  <!-- 下拉菜单 -->
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item>添加子部门</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
        <!-- 组织架构内容 -->
        <el-tree :data="list" default-expand-all />
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Departments',
  data() {
    return {
      // 1. 树形结构的数据
      list: [
        {
          label: '传智播客',
          children: [
            {
              label: '黑马程序员',
              children: [
                { label: '上海校区' },
                { label: '北京校区' },
                { label: '广州校区' }
              ]
            },
            { label: '博学谷' },
            { label: '传智专修学院' }
          ]
        },
        { label: '阿里巴巴' },
        { label: '字节跳动' }
      ]
    }
  }
}
</script>

<style>

</style>
